﻿@namespace BootstrapBlazor.Components
@typeparam TValue
@inherits BootstrapInput<TValue>

@if (IsShowLabel)
{
    <label class="control-label" required="@Required" for="@Id">@DisplayText</label>
}
@if (ShowButton)
{
    <div class="input-group">
        <div class="input-group-prepend">
            <button class="@ButtonClassString" type="button" @onclick="OnClickDec" disabled="@DisabledString">
                <i class="fa fa-fw fa-minus-circle"></i>
            </button>
        </div>
        <input @attributes="AdditionalAttributes" step="@StepString" min="@Min" max="@Max" id="@Id" type="number" class="@InputClassString" disabled="@DisabledString" @bind-value="@CurrentValueAsString" @bind-value:event="onchange" @onblur="@OnBlur" />
        <div class="input-group-append">
            <button class="@ButtonClassString" type="button" @onclick="OnClickInc" disabled="@DisabledString">
                <i class="fa fa-fw fa-plus-circle"></i>
            </button>
        </div>
    </div>
}
else
{
    <input @attributes="AdditionalAttributes" step="@StepString" min="@Min" max="@Max" id="@Id" type="number" class="@InputClassString" disabled="@DisabledString" @bind-value="@CurrentValueAsString" @bind-value:event="onchange" @onblur="@OnBlur" />
}
<CascadingValue Value="this" IsFixed="true">
    @ChildContent
</CascadingValue>
